package com.iotp.service.expert_type;

import com.iotp.dao.expert_type.ExpertTypeMapper;
import com.iotp.entity.expert_type.ExpertType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("expertTypeService")
public class ExpertTypeServiceImpl implements ExpertTypeService {
    @Autowired
    private ExpertTypeMapper expertTypeMapper;

    @Override
    public Long add(ExpertType expertType) {
        this.expertTypeMapper.insert(expertType);
        return expertType.getId();
    }

    @Override
    public void update(ExpertType expertType) {
        this.expertTypeMapper.updateByPrimaryKeySelective(expertType);
    }

    @Override
    public void delete(Long id) {
        this.expertTypeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public ExpertType queryById(Long id) {
        return this.expertTypeMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ExpertType> queryList(ExpertType expertType) {
        return this.expertTypeMapper.selectByCondition(expertType);
    }
}
